Skip to content

Fix annotation default target warnings in enum constructors#602

Open
gioalex07 wants to merge 2 commits intoVREMSoftwareDevelopment:mainfrom
gioalex07:fix/annotation-default-target-param
Open

Fix annotation default target warnings in enum constructors#602
gioalex07 wants to merge 2 commits intoVREMSoftwareDevelopment:mainfrom
gioalex07:fix/annotation-default-target-param

Conversation

@gioalex07
Copy link
Copy Markdown

Summary

  • Add explicit @param: target to @StringRes, @DrawableRes and @ColorRes annotations on enum constructor parameters.
  • Resolves Kotlin compiler warning KT-73255 across 5 files.
  • No logic changes.

What does this implement/fix?

Kotlin 2.x introduced a warning when @StringRes, @DrawableRes or @ColorRes are applied to enum constructor
parameters without an explicit annotation target. In a future release, these annotations will be applied to both
the parameter and the backing field by default. This change opts in to the parameter-only behavior explicitly
using the @param: target, silencing the warning and future-proofing the code.

Affected files:

  • wifi/band/WiFiBand.kt@param:StringRes
  • wifi/model/Strength.kt@param:DrawableRes, @param:ColorRes
  • wifi/model/WiFiSecurity.kt@param:DrawableRes, @param:StringRes
  • wifi/model/WiFiStandard.kt@param:StringRes (x2)
  • wifi/model/WiFiWidth.kt@param:StringRes

Does this close any issues?

  • N/A (compiler warning cleanup)

How was this tested?

  • Platform: WSL2 / AlmaLinux 9
  • Build variant: debug
  • Toolchain: JDK 21 (Zulu), Gradle 9.3.1, Android SDK 36, Kotlin 2.3.0

gioalex07 and others added 2 commits April 2, 2026 18:33
Add explicit @param: target to @stringres, @DrawableRes and @ColorRes
annotations on enum constructor parameters to suppress KT-73255 warnings.
Kotlin 2.x will apply these annotations to both parameter and field by
default in a future release; this change opts in to the parameter-only
behavior explicitly.

Affected files: WiFiBand, Strength, WiFiSecurity, WiFiStandard, WiFiWidth
@VREMSoftwareDevelopment
Copy link
Copy Markdown
Owner

Thanks for the contribution.

  1. AI Usage Disclosure
    Disclose any AI tool involvement and use the “AI assistance used” label.

  2. Testing Requirements
    Changes must be tested on a real Android device.
    Emulator‑only testing or running build tasks (e.g., ktlintCheck, unit tests, successful Gradle build) is not sufficient.
    UI/UX behavior, layouts, gestures, and rendering often differ between emulators and actual devices.

Please update the PR with real‑device testing details so review can continue.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.83%. Comparing base (bd25b4d) to head (a435fab).

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #602   +/-   ##
=========================================
  Coverage     97.83%   97.83%           
  Complexity      975      975           
=========================================
  Files           121      121           
  Lines          2581     2581           
  Branches        211      211           
=========================================
  Hits           2525     2525           
  Misses           19       19           
  Partials         37       37           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants